package com.whmall.service.crm.provider;

import com.whmall.component.entity.dto.OperatorReqDTO;
import com.whmall.component.entity.dto.PageReqDTO;
import com.whmall.component.entity.dto.PageRspDTO;
import com.whmall.service.crm.api.CompanyUserInvoiceApi;
import com.whmall.service.crm.entity.dto.company.CompanyUserInvoiceAddReqDTO;
import com.whmall.service.crm.entity.dto.company.CompanyUserInvoiceQueryReqDTO;
import com.whmall.component.entity.dto.CompanyUserInvoiceDTO;
import com.whmall.service.crm.entity.dto.company.CompanyUserInvoiceUpdateReqDTO;
import com.whmall.service.crm.module.company.service.CompanyUserInvoiceService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service(interfaceClass = CompanyUserInvoiceApi.class)
public class CompanyUserInvoiceProvider implements CompanyUserInvoiceApi {

    @Autowired
    private CompanyUserInvoiceService companyUserInvoiceService;

    @Override
    public Long add(CompanyUserInvoiceAddReqDTO reqDTO) {
        return companyUserInvoiceService.add(reqDTO);
    }

    @Override
    public void update(CompanyUserInvoiceUpdateReqDTO reqDTO) {
        companyUserInvoiceService.update(reqDTO);
    }

    @Override
    public void remove(Long id, OperatorReqDTO operator) {
        companyUserInvoiceService.remove(id, operator);
    }

    @Override
    public void setDefault(Long id, Long employeeId) {
        companyUserInvoiceService.setDefault(id, employeeId);
    }

    @Override
    public List<CompanyUserInvoiceDTO> list(CompanyUserInvoiceQueryReqDTO queryReqDTO) {
        return companyUserInvoiceService.list(queryReqDTO);
    }

    @Override
    public PageRspDTO<CompanyUserInvoiceDTO> list(PageReqDTO pageReqDTO, CompanyUserInvoiceQueryReqDTO reqDTO) {
        return companyUserInvoiceService.list(pageReqDTO, reqDTO);
    }

    @Override
    public CompanyUserInvoiceDTO getByCompanyId(Long companyId) {
        return companyUserInvoiceService.getByCompanyId(companyId);
    }
}
